<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8" />
    <style>
        #app-loader {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 100px;
            height: 100px;
            margin: -50px 0 0 -50px;
            pointer-events: none;
            border-radius: 50%;
            border: 8px solid rgba(0, 128, 192, 0.2);
            border-left: 8px solid #0080c0;
            animation: rotator 2s infinite linear;
        }

        @keyframes rotator {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }
        }
    </style>

    <link rel="stylesheet" href="../dist/fonts.css" type="text/css" />

    <script src="../dist/app.js" defer></script>

    <script>
        // We loaded all the assets we needed from the launcher now.
        // Time to change the base to the apps dist folder
        const params = new URL(window.location).searchParams;
        const appPath = params.get('appPath');

        const path = require('path');
        document.write(
            "<base href='" +
            appPath
                .split(path.sep)
                .map((val, index) =>
                    // Don't encode Windows `<drive>:`
                    process.platform === 'win32' && index === 0
                        ? val
                        : encodeURIComponent(val)
                )
                .join(path.sep) +
            "/dist/' />"
        );
        document.write(
            '<link rel="stylesheet" href="bootstrap.css" type="text/css" />'
        );
        document.write(
            '<link rel="stylesheet" href="bundle.css" type="text/css" />'
        );
    </script>
</head>

<body>
    <div id="webapp">
        <div id="app-loader"></div>
    </div>
</body>

</html>
